3.89 \(\int \cosh ^4(c+d x) (a+b \tanh ^2(c+d x))^2 \, dx\)

Optimal. Leaf size=85 \[ \frac{3 \left (a^2-b^2\right ) \sinh (c+d x) \cosh (c+d x)}{8 d}+\frac{1}{8} x \left (3 a^2-2 a b+3 b^2\right )+\frac{(a+b) \sinh (c+d x) \cosh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right )}{4 d} \]

[Out]

((3*a^2 - 2*a*b + 3*b^2)*x)/8 + (3*(a^2 - b^2)*Cosh[c + d*x]*Sinh[c + d*x])/(8*d) + ((a + b)*Cosh[c + d*x]^3*S
inh[c + d*x]*(a + b*Tanh[c + d*x]^2))/(4*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0868324, antiderivative size = 85, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.174, Rules used = {3675, 413, 385, 206} \[ \frac{3 \left (a^2-b^2\right ) \sinh (c+d x) \cosh (c+d x)}{8 d}+\frac{1}{8} x \left (3 a^2-2 a b+3 b^2\right )+\frac{(a+b) \sinh (c+d x) \cosh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right )}{4 d} \]

Antiderivative was successfully verified.

[In]

Int[Cosh[c + d*x]^4*(a + b*Tanh[c + d*x]^2)^2,x]

[Out]

((3*a^2 - 2*a*b + 3*b^2)*x)/8 + (3*(a^2 - b^2)*Cosh[c + d*x]*Sinh[c + d*x])/(8*d) + ((a + b)*Cosh[c + d*x]^3*S
inh[c + d*x]*(a + b*Tanh[c + d*x]^2))/(4*d)

Rule 3675

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[ff/(c^(m - 1)*f), Subst[Int[(c^2 + ff^2*x^2)^(m/2 - 1)*(a + b*(ff*x)
^n)^p, x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2] && (IntegersQ[n, p
] || IGtQ[m, 0] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])

Rule 413

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[((a*d - c*b)*x*(a + b*x^n)^
(p + 1)*(c + d*x^n)^(q - 1))/(a*b*n*(p + 1)), x] - Dist[1/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1)*(c + d*x^n)
^(q - 2)*Simp[c*(a*d - c*b*(n*(p + 1) + 1)) + d*(a*d*(n*(q - 1) + 1) - b*c*(n*(p + q) + 1))*x^n, x], x], x] /;
 FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && GtQ[q, 1] && IntBinomialQ[a, b, c, d, n, p, q
, x]

Rule 385

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> -Simp[((b*c - a*d)*x*(a + b*x^n)^(p +
 1))/(a*b*n*(p + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /
; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/n + p, 0])

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \cosh ^4(c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (a+b x^2\right )^2}{\left (1-x^2\right )^3} \, dx,x,\tanh (c+d x)\right )}{d}\\ &=\frac{(a+b) \cosh ^3(c+d x) \sinh (c+d x) \left (a+b \tanh ^2(c+d x)\right )}{4 d}-\frac{\operatorname{Subst}\left (\int \frac{-a (3 a-b)-(a-3 b) b x^2}{\left (1-x^2\right )^2} \, dx,x,\tanh (c+d x)\right )}{4 d}\\ &=\frac{3 \left (a^2-b^2\right ) \cosh (c+d x) \sinh (c+d x)}{8 d}+\frac{(a+b) \cosh ^3(c+d x) \sinh (c+d x) \left (a+b \tanh ^2(c+d x)\right )}{4 d}+\frac{\left (3 a^2-2 a b+3 b^2\right ) \operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\tanh (c+d x)\right )}{8 d}\\ &=\frac{1}{8} \left (3 a^2-2 a b+3 b^2\right ) x+\frac{3 \left (a^2-b^2\right ) \cosh (c+d x) \sinh (c+d x)}{8 d}+\frac{(a+b) \cosh ^3(c+d x) \sinh (c+d x) \left (a+b \tanh ^2(c+d x)\right )}{4 d}\\ \end{align*}

Mathematica [A]  time = 0.292658, size = 63, normalized size = 0.74 \[ \frac{4 \left (3 a^2-2 a b+3 b^2\right ) (c+d x)+8 \left (a^2-b^2\right ) \sinh (2 (c+d x))+(a+b)^2 \sinh (4 (c+d x))}{32 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cosh[c + d*x]^4*(a + b*Tanh[c + d*x]^2)^2,x]

[Out]

(4*(3*a^2 - 2*a*b + 3*b^2)*(c + d*x) + 8*(a^2 - b^2)*Sinh[2*(c + d*x)] + (a + b)^2*Sinh[4*(c + d*x)])/(32*d)

________________________________________________________________________________________

Maple [A]  time = 0.04, size = 124, normalized size = 1.5 \begin{align*}{\frac{1}{d} \left ({b}^{2} \left ( \left ({\frac{ \left ( \sinh \left ( dx+c \right ) \right ) ^{3}}{4}}-{\frac{3\,\sinh \left ( dx+c \right ) }{8}} \right ) \cosh \left ( dx+c \right ) +{\frac{3\,dx}{8}}+{\frac{3\,c}{8}} \right ) +2\,ab \left ( 1/4\,\sinh \left ( dx+c \right ) \left ( \cosh \left ( dx+c \right ) \right ) ^{3}-1/8\,\cosh \left ( dx+c \right ) \sinh \left ( dx+c \right ) -1/8\,dx-c/8 \right ) +{a}^{2} \left ( \left ({\frac{ \left ( \cosh \left ( dx+c \right ) \right ) ^{3}}{4}}+{\frac{3\,\cosh \left ( dx+c \right ) }{8}} \right ) \sinh \left ( dx+c \right ) +{\frac{3\,dx}{8}}+{\frac{3\,c}{8}} \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cosh(d*x+c)^4*(a+b*tanh(d*x+c)^2)^2,x)

[Out]

1/d*(b^2*((1/4*sinh(d*x+c)^3-3/8*sinh(d*x+c))*cosh(d*x+c)+3/8*d*x+3/8*c)+2*a*b*(1/4*sinh(d*x+c)*cosh(d*x+c)^3-
1/8*cosh(d*x+c)*sinh(d*x+c)-1/8*d*x-1/8*c)+a^2*((1/4*cosh(d*x+c)^3+3/8*cosh(d*x+c))*sinh(d*x+c)+3/8*d*x+3/8*c)
)

________________________________________________________________________________________

Maxima [B]  time = 1.03492, size = 231, normalized size = 2.72 \begin{align*} \frac{1}{64} \, a^{2}{\left (24 \, x + \frac{e^{\left (4 \, d x + 4 \, c\right )}}{d} + \frac{8 \, e^{\left (2 \, d x + 2 \, c\right )}}{d} - \frac{8 \, e^{\left (-2 \, d x - 2 \, c\right )}}{d} - \frac{e^{\left (-4 \, d x - 4 \, c\right )}}{d}\right )} + \frac{1}{64} \, b^{2}{\left (24 \, x + \frac{e^{\left (4 \, d x + 4 \, c\right )}}{d} - \frac{8 \, e^{\left (2 \, d x + 2 \, c\right )}}{d} + \frac{8 \, e^{\left (-2 \, d x - 2 \, c\right )}}{d} - \frac{e^{\left (-4 \, d x - 4 \, c\right )}}{d}\right )} - \frac{1}{32} \, a b{\left (\frac{8 \,{\left (d x + c\right )}}{d} - \frac{e^{\left (4 \, d x + 4 \, c\right )}}{d} + \frac{e^{\left (-4 \, d x - 4 \, c\right )}}{d}\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(d*x+c)^4*(a+b*tanh(d*x+c)^2)^2,x, algorithm="maxima")

[Out]

1/64*a^2*(24*x + e^(4*d*x + 4*c)/d + 8*e^(2*d*x + 2*c)/d - 8*e^(-2*d*x - 2*c)/d - e^(-4*d*x - 4*c)/d) + 1/64*b
^2*(24*x + e^(4*d*x + 4*c)/d - 8*e^(2*d*x + 2*c)/d + 8*e^(-2*d*x - 2*c)/d - e^(-4*d*x - 4*c)/d) - 1/32*a*b*(8*
(d*x + c)/d - e^(4*d*x + 4*c)/d + e^(-4*d*x - 4*c)/d)

________________________________________________________________________________________

Fricas [A]  time = 1.95999, size = 234, normalized size = 2.75 \begin{align*} \frac{{\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} +{\left (3 \, a^{2} - 2 \, a b + 3 \, b^{2}\right )} d x +{\left ({\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (d x + c\right )^{3} + 4 \,{\left (a^{2} - b^{2}\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )}{8 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(d*x+c)^4*(a+b*tanh(d*x+c)^2)^2,x, algorithm="fricas")

[Out]

1/8*((a^2 + 2*a*b + b^2)*cosh(d*x + c)*sinh(d*x + c)^3 + (3*a^2 - 2*a*b + 3*b^2)*d*x + ((a^2 + 2*a*b + b^2)*co
sh(d*x + c)^3 + 4*(a^2 - b^2)*cosh(d*x + c))*sinh(d*x + c))/d

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(d*x+c)**4*(a+b*tanh(d*x+c)**2)**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.93304, size = 255, normalized size = 3. \begin{align*} \frac{8 \,{\left (3 \, a^{2} - 2 \, a b + 3 \, b^{2}\right )} d x -{\left (18 \, a^{2} e^{\left (4 \, d x + 4 \, c\right )} - 12 \, a b e^{\left (4 \, d x + 4 \, c\right )} + 18 \, b^{2} e^{\left (4 \, d x + 4 \, c\right )} + 8 \, a^{2} e^{\left (2 \, d x + 2 \, c\right )} - 8 \, b^{2} e^{\left (2 \, d x + 2 \, c\right )} + a^{2} + 2 \, a b + b^{2}\right )} e^{\left (-4 \, d x - 4 \, c\right )} +{\left (a^{2} e^{\left (4 \, d x + 12 \, c\right )} + 2 \, a b e^{\left (4 \, d x + 12 \, c\right )} + b^{2} e^{\left (4 \, d x + 12 \, c\right )} + 8 \, a^{2} e^{\left (2 \, d x + 10 \, c\right )} - 8 \, b^{2} e^{\left (2 \, d x + 10 \, c\right )}\right )} e^{\left (-8 \, c\right )}}{64 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(d*x+c)^4*(a+b*tanh(d*x+c)^2)^2,x, algorithm="giac")

[Out]

1/64*(8*(3*a^2 - 2*a*b + 3*b^2)*d*x - (18*a^2*e^(4*d*x + 4*c) - 12*a*b*e^(4*d*x + 4*c) + 18*b^2*e^(4*d*x + 4*c
) + 8*a^2*e^(2*d*x + 2*c) - 8*b^2*e^(2*d*x + 2*c) + a^2 + 2*a*b + b^2)*e^(-4*d*x - 4*c) + (a^2*e^(4*d*x + 12*c
) + 2*a*b*e^(4*d*x + 12*c) + b^2*e^(4*d*x + 12*c) + 8*a^2*e^(2*d*x + 10*c) - 8*b^2*e^(2*d*x + 10*c))*e^(-8*c))
/d